clear; clc;
% clc;
%% Setup
InputParam_0    =   struct('XI',1/82.5/4,'Pir_SS',0.02/4,'KAPPA',0.00/4,...
                           'NU_C',1,'NU_L',1,...
                           'TrProb_ext',0.99,'Prob_ext',0.33,...
                           'TrProb_H',0.99,'Prob_H',0.37,...
                           'Fin_DomShare',0.79,'Fin_AdjCost',1,...
                           'Cons_FracT',0.5,'Cons_FracH',0.6,...
                           'B_Total_SS',0.91,'b_lb',-0.29);

Param_Benchmark =   SubFun_SteadyState_OutputParam(InputParam_0);                       
%% Different Integration Integration 
% Financial
List_Prob_ext   =   (0.10:0.1:0.90)';
Num_Fin         =   length(List_Prob_ext);
List_Param_Fin  =   cell(Num_Fin,1);
for ii=1:Num_Fin
    TempInputParam      =   InputParam_0;
    TempInputParam.Prob_ext=List_Prob_ext(ii);
    List_Param_Fin{ii}  =   SubFun_SteadyState_OutputParam(TempInputParam);
end

% Real 
List_Prob_H     =   (0.10:0.1:0.90)';

Num_Real        =   length(List_Prob_H);
List_Param_Real =   cell(Num_Real,1);
parfor ii=1:Num_Real
    TempInputParam      =   InputParam_0;
    TempInputParam.Prob_H=  List_Prob_H(ii);
    List_Param_Real{ii} =   SubFun_SteadyState_OutputParam(TempInputParam);
    
end

List_PP         =   struct('Fin',{List_Param_Fin},'Real',{List_Param_Real});

save('Result_4_IntegrationDegree.mat','Param_Benchmark','List_PP');

%% US vs CA
% CA
Param_CA            =   Param_Benchmark;
% US: Financial
TempInputParam      =   InputParam_0;
TempInputParam.Prob_ext ...
                    =   0.05;
Param_US_Fin        =   SubFun_SteadyState_OutputParam(TempInputParam);


% US: Real 
TempInputParam      =   InputParam_0;
TempInputParam.Prob_H ...
                    =   0.1;
Param_US_Real       =   SubFun_SteadyState_OutputParam(TempInputParam);

% US: Both
TempInputParam      =   InputParam_0;
TempInputParam.Prob_ext ...
                    =   0.05;
TempInputParam.Prob_H ...
                    =   0.1;
Param_US            =   SubFun_SteadyState_OutputParam(TempInputParam);

save('Result_4_IntegrationDegree_CAvsUS.mat','Param_CA','Param_US','Param_US_Fin','Param_US_Real');

